GetMediaSampleDescription
TheGetMediaSampleDescription
function allows you to retrieve a sample description from a media.
pascal void GetMediaSampleDescription (Media theMedia, long index, SampleDescriptionHandle descH);
theMedia
- Specifies the media for this operation. You obtain this media identifier from such Movie Toolbox functions as
NewTrackMedia
andGetTrackMedia
(described on page 2-138 and page 2-190, respectively).index
- Specifies the index of the sample description to retrieve. This index corresponds to the sample description itself, not the samples in the media.
descH
- Specifies a handle that is to receive the sample description. The Movie Toolbox correctly resizes this handle for the returned sample description. If there is no description for the specified index, the function returns this handle unchanged. Your application must allocate and dispose of this handle.
DESCRIPTION
This function provides a convenient way to retrieve information that describes a sample. For example, you can use this function to retrieve an image media's color lookup table.The format of sample descriptions differs by media type. Sample descriptions for image data are defined by image description structures, which are discussed in the chapter "Image Compression Manager" in this book. Sample descriptions for sound are defined by sound description structures, which are discussed earlier in this chapter. Sample descriptions for text are defined by text description data structures, which are described in "Text Media Handler Functions" beginning on page 2-272.
The Movie Toolbox identifies a media's sample descriptions with an index value. Index values always range from 1 to the number of sample descriptions in the media. Sample description indexes provide a convenient way to access each sample description
in a media.ERROR CODES
Memory Manager errors
invalidMedia -2008 This media is corrupted or invalid badDataRefIndex -2050 Data reference index value is invalid SEE ALSO
You can determine the number of sample descriptions in a media by calling theGetMediaSampleDescriptionCount
function, which is described in the
previous section.